{{include file="public/header" /}}
<style type="text/css">
body{ background:#EEEEEE;margin:0; padding:0; font-family:"微软雅黑", Arial, Helvetica, sans-serif; }
a{ color:#006600; text-decoration:none;}
a:hover{color:#990000;}
.top{ margin:5px auto; color:#990000; text-align:center;}
.info select{ border:1px #993300 solid; background:#FFFFFF;}
.info{ margin:5px; text-align:center;}
.info #show{ color:#3399FF; }
.bottom{ text-align:right; font-size:12px; color:#CCCCCC; width:1000px;}
</style>

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- form start -->
        <form class="am-form form-validation view-save" action="{{:MyUrl('admin/Warehouse/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/Warehouse/index', $params)}}" enctype="multipart/form-data">
            <legend>
                <span class="fs-16">
                    {{if empty($data['id'])}}
                    仓库添加
                    {{else /}}
                    仓库编辑
                    {{/if}}
                </span>
             <a href="javascript:window.history.back();" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
            </legend>
            <!-- 基础信息 -->
            <div id="goods-nav-base" class="division-block"> 
                <div class="am-form-group">
                    <label>仓库名称<span class="am-form-group-label-tips" style="color:red">*</span></label>
                    <input type="text" name="warehouse_name" placeholder="作者名称" maxlength="60" data-validation-message="仓库名称 最多60个字符" class="am-radius" {{if !empty($data)}} value="{{$data.warehouse_name}}"{{/if}} />

                </div>
                <div class="am-form-group">
                    <label>仓库管理员<span class="am-form-group-label-tips" style="color:red">*</span></label>
                    <br />
                    <select name="aid" class="am-radius chosen-select" minchecked="1" data-placeholder="请选择..." data-validation-message="请选择仓库管理员" required>


                        {{if !empty($warehouseAdmin)}}
                        {{foreach $warehouseAdmin as $kk=>$vs}}
                        <option style="padding-left: 30px;" value="{{$vs['id']}}" {{if isset($data['aid']) and $data['aid'] eq $vs['id']}}selected{{/if}} >{{$vs['username']}}</option>

                        {{/foreach}}
                        {{/if}}

                    </select>
                </div>
                <div class="am-form-group">
                    <label>仓库代码</label>
                    <input type="text" name="code" placeholder="仓库代码"  class="am-radius" {{if !empty($data)}} value="{{$data.code}}"{{/if}} />
                </div>

                <div class="am-form-group">
                    <label>联系电话</label>
                    <input type="text" name="phone" placeholder="联系电话" class="am-radius" {{if !empty($data)}} value="{{$data.phone}}"{{/if}} />
                </div>
                <div class="am-form-group" style="height:70px">
                    <div> <label>仓库地址</label></div>
                       
                    <select  style="width:200px;float:left" id="s_province" name="province_name"></select>&nbsp;&nbsp;
                    <select  style="width:200px;float:left" id="s_city" name="city_name" ></select>&nbsp;&nbsp;
                    <select   style="width:200px;float:left" id="s_county" name="exparea_name"></select>
                 
                   
                </div>
                <div class="am-form-group">
                    <label>仓库地址</label>
                    <input type="text" name="address" placeholder="仓库地址" maxlength="160" class="am-radius" {{if !empty($data)}} value="{{$data.address}}"{{/if}} />
                </div>
                
                <div class="am-form-group">
                    <label>仓库描述</label>
                    <input type="text" name="describe" placeholder="仓库描述" maxlength="160" data-validation-message="仓库描述 最多160个字符" class="am-radius" {{if !empty($data)}} value="{{$data.describe}}"{{/if}} />
                </div>

                <div class="am-form-group">
                    <label>仓库面积（单位：平方米）</label>
                    <input type="text" name="size" placeholder="仓库面积" class="am-radius" {{if !empty($data)}} value="{{$data.size}}"{{/if}} />
                </div>  

            </div>

            <div class="am-form-group am-form-group-refreshing">
                <input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
                       <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
            </div>
        </form>
        <!-- form end -->
    </div>
</div>
<!-- right content end  -->


<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/admin/default/js/area.js"></script>    <script type="text/javascript">_init_area();</script>

<!-- footer start -->
{{include file="public/footer" /}}
<script type="text/javascript">
var Gid  = document.getElementById ;
var showArea = function(){
	Gid('show').innerHTML = "<h3>省" + Gid('s_province').value + " - 市" + 	
	Gid('s_city').value + " - 县/区" + 
	Gid('s_county').value + "</h3>"
							}
Gid('s_county').setAttribute('onchange','showArea()');
</script>

<!-- footer end -->
